print(Packages.test.com.jse.FtpTest.name)
var FtpClient=Packages.sun.net.ftp.impl.FtpClient;
var ftpClient =new FtpClient();
ftpClient.connect(new java.net.InetSocketAddress("ftp.mozilla.org", 21));
//ftpClient.login("yourname", "yourpass".toCharArray());
// 列出当前用户的工作目录
var workingDirectory = ftpClient.getWorkingDirectory();
System.out.println("working directory:" + workingDirectory);
// 下载 到本地
var outputFile = "D:\\robots.txt";
// ftp当前用户工作目录下的文件名
ftpClient.getFile("robots.txt", new java.io.FileOutputStream(outputFile));
// 上传
//var uploadFile = "D:\\work\\readme.txt";
// 指定ftp工作目录还不够，必须要指定到文件名
//ftpClient.putFile(workingDirectory + "/readme.txt", new java.io.FileInputStream(uploadFile));